package com.itmeima.text1;

import java.lang.reflect.Method;
import java.util.ArrayList;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        ArrayList<Integer> list = new ArrayList<>();

        Class aClass = list.getClass();

        Method add = aClass.getMethod("add", Object.class);

        add.invoke(list,"asdasd");
        add.invoke(list,"点点点点点");
        add.invoke(list,123124);

        System.out.println(list);
    }
}
